package com.ingsing.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ingsing.user.model.po.User;
import org.apache.ibatis.annotations.Param;

/**
 * @author: NALHOUG
 * @time: 2019/10/31 15:30
 * @explain:
 */
public interface UserMapper extends BaseMapper<User> {

    User selectByUsername(String username);

    /**
     * @param email
     * @return 查询邮箱
     */
    User selectByEmail(String email);

    /**
     * @param phone
     * @return 查询手机号
     */
    User selectByPhone(String phone);
    /**
     * @param userId
     * @return 关闭账户
     */
    int offAccount(Integer userId);

    /**
     * @param userId
     * @return 禁用账户
     */
    int disableAccount(Integer userId);

    /**
     * @param userId
     * @return 设置异常
     */
    int abnormalAccount(Integer userId);

    /**
     * @param userId
     * @return 更新登录时间
     */
    int setLastLogin(@Param("userId")int userId);
}